// This is the form that controls Image upload and Text Editor
#tandem-editor-wym
  = form_for @content, url: tandem.content_path(@content.id), remote: true, html: {class: "tandem_content_editor tandem_#{@content.class.simple_type}_editor"} do |f|
    -if @content.errors.any?
      #tandem_error_explanation
        h2 = "#{pluralize(@content.errors.count, "error")} prohibited this content from being saved:"
        ul
          - @content.errors.full_messages.each do |msg|
            li= msg

    -if @content.is_a?(Tandem::Content::Text)
      .field
        = f.text_area :content, text_content_text_area_options(params[:editor])

    -if @content.is_a?(Tandem::Content::Image)
      = render_eco_template 'current_image', @content.image.as_json

    #tandem_advanced_settings
      h3.settings-toggle Advanced Settings
      .advanced-settings
        .field
          = f.label :link_url
          = f.text_field :link_url
        .field
          = f.label :link_target
          = f.text_field :link_target

    .actions
      = f.submit 'Save Your Changes', class: "wymupdate"

  - if @content.is_a?(Tandem::Content::Image)
    div#tandem-image-editor.clearfix
      = render '/tandem/images/form'

      #gallery-image.clearfix
        = render '/tandem/images/gallery'
